/*
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *如果数据库字段发生变化，请在代码生器重新生成此Model
 */
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;
using VOL.Entity.SystemModels;

namespace VOL.Entity.DomainModels
{
    [SugarTable("stockinorderitemmodel", TableDescription = "入库单明细表")]
    [Entity(TableCnName = "入库单明细表", TableName = "stockinorderitemmodel")]
    public partial class StockInOrderItemModel : BaseEntity
    {
        /// <summary>
        /// 主键
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        [Key]
        [Display(Name = "主键")]
        [Column(TypeName = "bigint")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public long Id { get; set; }

        /// <summary>
        /// 关联入库单主表的id
        /// </summary>
        [Display(Name = "关联入库单主表的id")]
        [Column(TypeName = "bigint")]
        [Editable(true)]
        public long? stockInOrderId { get; set; }

        /// <summary>
        /// 所属入库单号（如果数据库中没有此字段，需要执行 SQL 添加）
        /// </summary>
        [SugarColumn(IsNullable = true)]
        [Display(Name = "所属入库单号")]
        [MaxLength(100)]
        [Column(TypeName = "varchar(100)")]
        [Editable(true)]
        public string StockInCode { get; set; }

        /// <summary>
        /// 货品 ID
        /// </summary>
        [Display(Name = "货品ID")]
        [Column(TypeName = "bigint")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public long GoodsId { get; set; }

        /// <summary>
        /// 货品编号
        /// </summary>
        [Display(Name = "货品编号")]
        [MaxLength(255)]
        [Column(TypeName = "varchar(255)")]
        [Editable(true)]
        public string GoodsCode { get; set; }

        /// <summary>
        /// 货品名称
        /// </summary>
        [Display(Name = "货品名称")]
        [MaxLength(255)]
        [Column(TypeName = "varchar(255)")]
        [Editable(true)]
        public string GoodsName { get; set; }

        /// <summary>
        /// 规格型号（数据库字段名：specificationModel）
        /// </summary>
        [SugarColumn(ColumnName = "specificationModel")]
        [Display(Name = "规格型号")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string SpecModel { get; set; }

        /// <summary>
        /// 单位 ID
        /// </summary>
        [Display(Name = "单位ID")]
        [Column(TypeName = "bigint")]
        [Editable(true)]
        public long? UnitId { get; set; }

        /// <summary>
        /// 货品类型 ID
        /// </summary>
        [Display(Name = "货品类型ID")]
        [Column(TypeName = "bigint")]
        [Editable(true)]
        public long? goodsTypeId { get; set; }

        /// <summary>
        /// 当前库存
        /// </summary>
        [Display(Name = "当前库存")]
        [Column(TypeName = "bigint")]
        [Editable(true)]
        public long? currentInventory { get; set; }

        /// <summary>
        /// 进货数量
        /// </summary>
        [Display(Name = "进货数量")]
        [Column(TypeName = "int")]
        [Editable(true)]
        public int? purchaseQuantity { get; set; }

        /// <summary>
        /// 已入库数量
        /// </summary>
        [Display(Name = "已入库数量")]
        [Column(TypeName = "int")]
        [Editable(true)]
        public int? inStockedQuantity { get; set; }

        /// <summary>
        /// 未入库数量
        /// </summary>
        [Display(Name = "未入库数量")]
        [Column(TypeName = "int")]
        [Editable(true)]
        public int? unStockedQuantity { get; set; }

        /// <summary>
        /// 入库库位ID（数据库字段名：stockPositionId）
        /// </summary>
        [SugarColumn(ColumnName = "stockPositionId", IsNullable = true)]
        [Display(Name = "入库库位ID")]
        [Column(TypeName = "bigint")]
        [Editable(true)]
        public long? stockPosition { get; set; }

        /// <summary>
        /// 本次入库数量 (需 > 0，且≤unStockedQuantity)，支持分批入库
        /// </summary>
        [Display(Name = "本次入库数量")]
        [Column(TypeName = "int")]
        [Editable(true)]
        public int? thisTimeQuantity { get; set; }

        /// <summary>
        /// 进货单价
        /// </summary>
        [Display(Name = "进货单价")]
        [Column(TypeName = "int")]
        [Editable(true)]
        public int? purchasePrice { get; set; }

        /// <summary>
        /// 本次入库金额（支持分批入库）
        /// </summary>
        [Display(Name = "本次入库金额")]
        [MaxLength(50)]
        [Column(TypeName = "varchar(50)")]
        [Editable(true)]
        public string upprice { get; set; }

        /// <summary>
        /// 批次号 (关联GoodsBatchModel的batchNo)
        /// </summary>
        [Display(Name = "批次号")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string batchNo { get; set; }

        /// <summary>
        /// 生产日期
        /// </summary>
        [Display(Name = "生产日期")]
        [Column(TypeName = "datetime")]
        [Editable(true)]
        public DateTime? productionDate { get; set; }

        /// <summary>
        /// 过期日期
        /// </summary>
        [Display(Name = "过期日期")]
        [Column(TypeName = "datetime")]
        [Editable(true)]
        public DateTime? expireDate { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [Display(Name = "备注")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string remark { get; set; }

        /// <summary>
        /// 删除标识
        /// </summary>
        [Display(Name = "删除标识")]
        [Column(TypeName = "tinyint")]
        [Editable(true)]
        public sbyte? IsDel { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        [Display(Name = "创建人")]
        [MaxLength(15)]
        [Column(TypeName = "varchar(15)")]
        [Editable(true)]
        public string Creator { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Display(Name = "创建时间")]
        [Column(TypeName = "datetime")]
        [Editable(true)]
        public DateTime? CreateDate { get; set; }

        /// <summary>
        /// 修改人
        /// </summary>
        [Display(Name = "修改人")]
        [MaxLength(15)]
        [Column(TypeName = "varchar(15)")]
        [Editable(true)]
        public string Modifier { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        [Display(Name = "修改时间")]
        [Column(TypeName = "datetime")]
        [Editable(true)]
        public DateTime? ModifyDate { get; set; }

        /// <summary>
        /// 创建人id
        /// </summary>
        [Display(Name = "创建人id")]
        [Column(TypeName = "int")]
        [Editable(true)]
        public int? CreateID { get; set; }

        /// <summary>
        /// 修改人id
        /// </summary>
        [Display(Name = "修改人id")]
        [Column(TypeName = "int")]
        [Editable(true)]
        public int? ModifyID { get; set; }
    }
}

